package org.microdream.easy.deploy.po;

import ice.server.comm.PoExtender;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Objects;

@Entity
@Table(name = "d_menu", schema = "easydeploy", catalog = "")
public class DMenu  extends PoExtender implements Serializable {
    private static final long serialVersionUID = 1L;
    private int id;
    private String menuName;
    private String menuCode;
    private String menuFCode;
    private String menuImage;
    private int menuLevel;
    private int isShow;
    private Integer showOrder;
    private String menuUrl;
    private String updateUser;
    private Timestamp updateTime;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "menu_name")
    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    @Basic
    @Column(name = "menu_code")
    public String getMenuCode() {
        return menuCode;
    }

    public void setMenuCode(String menuCode) {
        this.menuCode = menuCode;
    }

    @Basic
    @Column(name = "menu_f_code")
    public String getMenuFCode() {
        return menuFCode;
    }

    public void setMenuFCode(String menuFCode) {
        this.menuFCode = menuFCode;
    }

    @Basic
    @Column(name = "menu_image")
    public String getMenuImage() {
        return menuImage;
    }

    public void setMenuImage(String menuImage) {
        this.menuImage = menuImage;
    }

    @Basic
    @Column(name = "menu_level")
    public int getMenuLevel() {
        return menuLevel;
    }

    public void setMenuLevel(int menuLevel) {
        this.menuLevel = menuLevel;
    }

    @Basic
    @Column(name = "is_show")
    public int getIsShow() {
        return isShow;
    }

    public void setIsShow(int isShow) {
        this.isShow = isShow;
    }

    @Basic
    @Column(name = "show_order")
    public Integer getShowOrder() {
        return showOrder;
    }

    public void setShowOrder(Integer showOrder) {
        this.showOrder = showOrder;
    }

    @Basic
    @Column(name = "menu_url")
    public String getMenuUrl() {
        return menuUrl;
    }

    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl;
    }

    @Basic
    @Column(name = "update_user")
    public String getUpdateUser() {
        return updateUser;
    }

    public void setUpdateUser(String updateUser) {
        this.updateUser = updateUser;
    }

    @Basic
    @Column(name = "update_time")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DMenu dMenu = (DMenu) o;
        return id == dMenu.id &&
                menuLevel == dMenu.menuLevel &&
                isShow == dMenu.isShow &&
                Objects.equals(menuName, dMenu.menuName) &&
                Objects.equals(menuCode, dMenu.menuCode) &&
                Objects.equals(menuFCode, dMenu.menuFCode) &&
                Objects.equals(menuImage, dMenu.menuImage) &&
                Objects.equals(showOrder, dMenu.showOrder) &&
                Objects.equals(menuUrl, dMenu.menuUrl) &&
                Objects.equals(updateUser, dMenu.updateUser) &&
                Objects.equals(updateTime, dMenu.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, menuName, menuCode, menuFCode, menuImage, menuLevel, isShow, showOrder, menuUrl, updateUser, updateTime);
    }
}
